<?php
/**
 * Created by PhpStorm.
 * User: Artem
 * Date: 05.12.2014
 * Time: 12:20
 */

namespace Orm;

class DataBase
{

    public function  GetConn()
    {
        // Set DSN
        $dsn = 'mysql:host=' . $this->host . ';dbname=' . $this->dbname;
        // Set options
        $options = array(
            PDO::ATTR_PERSISTENT => true,
            PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION
        );
        // Create a new PDO instanace
        try {
            $this->dbh = new PDO($dsn, $this->user, $this->pass, $options);
        } // Catch any errors
        catch
        (PDOException $e) {
            $this->error = $e->getMessage();
        }
    }
}

}